const recursonRoutes = (menuList, routes) => {
  let useMenu = [];
  menuList.forEach((menu) => {
    routes.forEach((route) => {
      if (menu.title === route.meta.title) {
        if (menu.children && route.meta.title) {
          route.children = recursonRoutes(menu.children, route.children);
        }
        useMenu.push(route);
      }
    });
  });
  return useMenu;
};

export default recursonRoutes;
